import mock from "./utils/mock";

//app.js
App({
  onLaunch: function () {
    // 展示本地存储能力
	console.log(0);
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    //wx.setStorageSync('logs', logs)
	
    let that=this;
    let userInfo={
    	openId:'',
    	jifen:'',
    	nickName:'',
    	avatarUrl:'',
    	headerValue:'',
    	id:''
    }
    
    // 获取用户信息
    wx.getSetting({
      success: res => {
        if (res.authSetting['scope.userInfo']) {
          // 已经授权，可以直接调用 getUserInfo 获取头像昵称，不会弹框
          wx.getUserInfo({
            success: res => {
				console.log(res);
              // 可以将 res 发送给后台解码出 unionId
              this.globalData.userInfo = res.userInfo
  
              // 由于 getUserInfo 是网络请求，可能会在 Page.onLoad 之后才返回
              // 所以此处加入 callback 以防止这种情况
              if (this.userInfoReadyCallback) {
                this.userInfoReadyCallback(res)
              }
            }
          })
        }
      }
    })
  },
  globalData: {
		userInfo: null, 
		/* baseimg:'http://192.168.2.89:8080/path/image/logo.jpg',
		baseurl:'http://192.168.2.89:8080',//* 线下邱 */
		baseimg:'http://192.168.2.61:8080/path/image/logo/logo.png',
		baseurl:'http://192.168.2.61:8080',//* 线下吴
		/* baseimg:'http://192.168.2.89:8080/path/image/logo/logo.png',
		baseurl:'http://192.168.2.89:8080',//* 线上 */ 
		/* baseimg:'http://dycapi.dzv7.com/path/image/logo/logo.png',
		baseurl:'http://dycapi.dzv7.com',//* 线上 */
		/* baseimg:'http://120.78.139.135:8088/path/image/logo/logo.png', 
	    baseurl: 'http://120.78.139.135:8088', //* 线上 */
		/* baseimgurl: 'http://www.510513.site' */
		
		
  }
  
})

/* 
 ,
 "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#000",
     "navigationBarTitleText": "御座+",
     "navigationBarTextStyle": "white"
 },
 "tabBar": {
     "selectedColor": "#ff6700",
     "borderStyle": "white",
     "backgroundColor": "#fff",
     "list": [
         {
             "text": "首页",
             "pagePath": "pages/index/index",
             "iconPath": "assets/icons/home.png",
             "selectedIconPath": "assets/icons/home_active.png"
         },
         {
             "text": "积分商城",
             "pagePath": "pages/shopcenter/shopcenter",
             "iconPath": "assets/icons/category.png",
             "selectedIconPath": "assets/icons/category_active.png"
         },
         {
             "text": "签到",
             "pagePath": "pages/discovery/discovery",
             "iconPath": "assets/icons/discovery.png",
             "selectedIconPath": "assets/icons/discovery_active.png"
         },
         {
             "text": "购物车",
             "pagePath": "pages/cart/cart",
             "iconPath": "assets/icons/cart.png",
             "selectedIconPath": "assets/icons/cart_active.png"
         },
         {
             "text": "我的",
             "pagePath": "pages/mine/mine",
             "iconPath": "assets/icons/mine.png",
             "selectedIconPath": "assets/icons/mine_active.png"
         }
     ]
 }*/